-
-
Notifications
You must be signed in to change notification settings - Fork 303
[Seoya0512] WEEK1 solutions #2000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
BaeKwangho
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
정성스러운 주석 덕분에 리뷰가 재밌었습니다. 남은 시간도 화이팅 하세요
top-k-frequent-elements/Seoya0512.py
Outdated
| - 버킷을 뒤에서부터 순회하며 상위 k개 숫자 채우기: O(n) | ||
|
|
||
| Space Complexity: O(n) | ||
| - freq 딕셔너리와 bucket 리스트로 인해 O(n) 발생 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
freq 딕셔너리가 없어서 살짝 헷갈렸어요. hash_map 을 말씀하시는게 맞을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오, 네네 맞습니다👍
top-k-frequent-elements/Seoya0512.py
Outdated
| for num in nums: | ||
| hash_map[num] = hash_map.get(num, 0) + 1 | ||
|
|
||
| # 인덱스 = 등장 횟수, 값 = 그 횟수만큼 등장한 숫자 리스트 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
최대한 작성해두신 구현방식을 이해해보려고 했는데, 어려웠던 것 같아요!
예시 포맷을 작성해 두는 것도 좋은 방법일 것 같습니다. 저도 그래야겠어요 ㅎㅎ...
| # 인덱스 = 등장 횟수, 값 = 그 횟수만큼 등장한 숫자 리스트 | |
| # e.g) let nums = [1,6,6,3,2,6,8], bucket = [[1,3,2,8],[],[6]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오오 좋은 주석 방식 공유해주셔서 감사합니다
| return [] | ||
|
|
||
| ''' | ||
| (개선) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋은 개선포인트네요! 👏
|
코드 리뷰 주신 내용을 보고 참고하고자 확인해봤는데 너무 잘 작성되어 있어서 한 수 배우고 갑니다. ㅎㅎ |
TonyKim9401
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1주차 문제 풀이 고생하셨습니다!
온보딩 및 스터디 적응 하시는데 앞으로 조금 더 힘내주시고 앞으로의 15주간 여정 응원합니다.
2주차 문제 풀이도 파이팅입니다!
답안 제출 문제
작성자 체크 리스트
In Review로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!